import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main5(String[] args) {
        String abc = "abc";
        String abcde = "abcde";
        String one = "1";
        String two = "2";
        String one2 = "1";
        System.out.println("字符比较===="+abc.compareTo(abcde));//-2返回字符串长度
        System.out.println("字符数字比较===="+one.compareTo(two));//-1返回字符串长度
        System.out.println("字符数字比较2===="+one.compareTo(one2));//0两个数字进行比较
    }

    public static void main6(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int count = 0;
        while (num!=0) {
            if((num&1)==1){
                count++;
            }
            num>>=1;
        }
        System.out.println(count);

    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        String[] str = new String[num];
        String t = scanner.nextLine();
        for(int i = 0;i<num;i++){
            str[i] = scanner.nextLine();
        }
        String tem = new String();
        for(int i =0;i<str.length;i++){
            boolean time = false;
            for(int j = 1;j< str.length;j++){
                if(str[j].compareTo(str[j-1])<0){
                    tem = str[j];
                    str[j] = str[j-1];
                    str[j-1] = tem;
                    time = true;
                }
            }
            if(time==false){
                break;
            }
        }
        for(int i = 0;i< str.length;i++){
            System.out.println(str[i]);
        }

    }
















    public static String reverse2(String str1){
        String[] array = str1.split(" ");
        String str = new String();
        int left = 0;
        int right = array.length-1;
        while(left<right){
            str = array[left];
            array[left] = array[right];
            array[right] = str;
            left++;
            right--;
        }
        StringBuilder result = new StringBuilder();
        for(int i = 0;i< array.length;i++){
            result.append(array[i]).append(" ");
        }
        return result.toString();

    }


    public static void main4(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        str = reverse2(str);
        System.out.println(str);
    }

    public static String reverse1(String str){
        char[] array = str.toCharArray();
        int left = 0;
        int right = array.length-1;
        while(left<right){
            char tem = array[left];
            array[left] = array[right];
            array[right] = tem;
            left++;
            right--;
        }
        return new String(array);
    }

    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();

        str = reverse1(str);

        System.out.println(str);

    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        StringBuilder str1 = new StringBuilder(str);
        str = str1.reverse().toString();
        System.out.println(str);



    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int[] arr = new int[128];
        int count = 0;
        for(int i = 0;i<str.length();i++){
            int ch = str.charAt(i);
            if(arr[ch]==0){
                count++;
                arr[ch]++;
            }
        }
        System.out.println(count);
    }
}
